package com.jdjr.drools.core.enums;

/**
 * Drools属性（12）
 */
public enum EmDroolsAttribute {

    SALIENCE("salience", "优先级"),
    NO_LOOP("no-loop", "防止死循环"),
    DATE_EFFECTIVE("date-effective", "日期比较小于等于"),
    DATE_EXPIRES("date_expires", "日期比较大于"),
    DIALECT("dialect", "方言"),
    ENABLED("enabled", "是否可用"),
    LOCK_ON_ACTIVE("lock_on_active", "规则只执行一次"),
    ACTIVATION_GROUP("activation_group", "分组"),
    AGENDA_GROUP("agenda_group", "议程分组"),
    AUTO_FOCUS("auto_focus", "焦点分组"),
    RULEFLOW_GROUP("ruleflow_group", "规则流"),
    DURATION("duration", "定时器");

    private final String value;
    private final String title;

    EmDroolsAttribute(String value, String title) {
        this.value = value;
        this.title = title;
    }

    public String getValue() {
        return value;
    }

    public String getTitle() {
        return title;
    }

    @Override
    public String toString() {
        return this.title;
    }

    public static EmDroolsAttribute of(final String value) {
        for (EmDroolsAttribute rpt : EmDroolsAttribute.values()) {
            if (rpt.value == value) {
                return rpt;
            }
        }
        return null;
    }

}
